#pragma once

#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

typedef uint8_t MacAddr[6];

typedef uint8_t Ipv4Addr[4];

typedef struct Addresses {
  MacAddr source_mac_addr;
  Ipv4Addr source_ip_addr;
  MacAddr des_mac_addr;
  Ipv4Addr des_ip_addr;
} Addresses;

typedef enum None_or_Addresses_Tag {
  Some_Addresses,
  None_Addresses,
} None_or_Addresses_Tag;

typedef struct None_or_Addresses {
  None_or_Addresses_Tag tag;
  union {
    struct {
      struct Addresses some;
    };
  };
} None_or_Addresses;

typedef enum None_or_String_Tag {
  Some_____c_char,
  None_____c_char,
} None_or_String_Tag;

typedef struct None_or_String {
  None_or_String_Tag tag;
  union {
    struct {
      char *some;
    };
  };
} None_or_String;

struct None_or_Addresses get_default_addrs(void);

struct None_or_String find_default_dev_name(void);

uint8_t send_dns_packet(uint16_t pkt_id,
                        uint16_t s_port,
                        const struct Addresses *addrs,
                        const char *domain);
